package com.jdpc.weparty.controller.vo

import com.jdpc.weparty.entity.Activity
import com.jdpc.weparty.entity.ActivityType
import com.jdpc.weparty.entity.Banner

class ActivityInfoVo {
    var activityId = -1
    var activityName: String = ""
    var activityLocation: String = ""
    var activityStart: Long = -1
    var activityEnd: Long = -1
    var activityProfile: String = ""//活动简介
    var activityKind: ActivityType = ActivityType.OTHERS//活动类型
    var activityPic = "" //活动图片

    var joinNum = 0 //参与人数
    var publisherId = 0 //活动发布者id
    var activityBanners: List<Banner?> = ArrayList()

    constructor() {

    }

    constructor(activity: Activity, joinNum: Int = 0) {
        activity.let {
            this.activityId = it.id
            this.activityEnd = it.endTime
            this.activityStart = it.startTime
            this.activityName = it.activityName
            this.activityKind = it.activityType
            this.activityProfile = it.activityProfile
            this.activityLocation = it.location
            this.activityPic = it.activityPic
            this.publisherId = it.publisher.id
            this.activityBanners = it.banners.orEmpty().toList()
        }
        this.joinNum = joinNum
    }


}